package com.jinlong.service.impl;


import com.jinlong.api.server.DemoApiService;
import com.jinlong.common.api.BaseApiService;
import com.jinlong.common.redis.BaseRedisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@Slf4j
public class DemoApiServiceImpl extends BaseApiService implements DemoApiService {

    @Autowired
    BaseRedisService baseRedisService;
    @Override
    public Map<String,Object> demo() {
        log.info("this is demo");
        return setResultSuccess();
    }

    @Override
    public Map<String, Object> setKey(String key, String value) {
        baseRedisService.setString(key,value);
        return setResultSuccess();
    }

    @Override
    public Map<String, Object> getKey(String key) {
        String value = baseRedisService.get(key);

        return setResultSuccessData(value);
    }
}
